package com.sfzy.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sfzy.entity.ConsultantTag;
import com.sfzy.mapper.ConsultantTagMapper;
import com.sfzy.service.ConsultantTagService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ConsultantTagImpl implements ConsultantTagService {
    @Autowired
    private ConsultantTagMapper consultantTagMapper;

    @Override
    public int insertConsultantTag(ConsultantTag consultantTag) {
        return consultantTagMapper.insertConsultantTag(consultantTag);
    }

    @Override
    public int deleteConsultantTag(int id) {
        return consultantTagMapper.deleteConsultantTag(id);
    }

    @Override
    public int updateConsultantTag(ConsultantTag consultantTag) {
        return consultantTagMapper.updateConsultantTag(consultantTag);
    }

    @Override
    public ConsultantTag selectConsultantTagById(int id) {
        return consultantTagMapper.selectConsultantTagById(id);
    }

    @Override
    public PageInfo<ConsultantTag> selectAllConsultantTags(ConsultantTag consultantTag, int pageNum, int pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<ConsultantTag> consultantTags = consultantTagMapper.selectAllConsultantTags(consultantTag);
        PageInfo<ConsultantTag> pageInfo = new PageInfo<>(consultantTags);
        return pageInfo;
    }
}
